package odv.view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;

import javax.swing.JButton;
import javax.swing.JFrame;

import bean.vo.ItemListaPreciosVO;

public class ListarPrecios extends javax.swing.JFrame{

    private static final long serialVersionUID = 1L;
    private ListarPrecios instancia;
    private JButton buttonCerrar;
    
    public ListarPrecios(List<ItemListaPreciosVO>precios){
        super();
        initGUI(precios);
        instancia = this;
    }

    private void initGUI(List<ItemListaPreciosVO>precios) {
        
        this.setLayout(null);
        //Create and set up the window.
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    PanelTablaListaPrecios newContentPane = new PanelTablaListaPrecios(precios);
    newContentPane.setOpaque(true); //content panes must be opaque
    this.setContentPane(newContentPane);

    //Display the window.
    this.setSize(1024, 768);
    this.setVisible(true);
            
    buttonCerrar = new JButton();
    this.add(buttonCerrar);
    buttonCerrar.setText("Cerrar Listado");
    buttonCerrar.setBounds(162,330, 150, 21);
    buttonCerrar.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt)
        {
                instancia.dispose();
        }
    });
    }
}